/*wangp start*/

/*弹出框  时间3秒限制*/
function common_a_div(a_message){ 
	$(".pop_cover").show();
	$(".c_pop").show();
	$("#quxiaoresult").html(a_message);
	setTimeout(function(){
		$(".pop_cover").hide();
		$(".c_pop").hide();
	},3000);
} 

/*弹出框  传入时间*/
function common_atime_div(a_message,atime,alink){  
	$(".pop_cover").show();
	$(".c_pop").show();
	$("#quxiaoresult").html(a_message);
	setTimeout(function(){
		$(".pop_cover").hide();
		$(".c_pop").hide();
		location.href=alink;
	},atime);
	
}
//分页通用js
function pageAjax(id,param,url){ 
	$.ajax({
		type:"POST",
		async:false,
		url:url,
		data:param,
		success:function(root){
			document.getElementById(id).innerHTML=root;
		}
	});
} 

//个人中心推荐页专用分页js
function pageAjaxUcenter(id,param,url,type){ 
	$.ajax({
		type:"POST",
		async:false,
		url:url,
		data:param,
		success:function(root){
			document.getElementById(id).innerHTML=root;
			/*if(type=='0'){
				 $("#myrecommend_div:eq(0)").html(root);
			}else{
				 $("#myrecommend_div:eq(1)").html(root);
			}*/
		}
	});
} 

/**
 * 跳转到搜索总页
 */
function goSearchResultAll(serverpath){
	//alert(serverpath);
	location.href=serverpath+"/search/search_result.3.jsp";
}

/**
 * 音乐频道链接
 */
function goMusicLink(serverpath,is_mlink_login){
	var sourceurl="http://124.128.254.200/Wap/default.aspx";
	if("true" == is_mlink_login){
		   jQuery.ajax({
				url:serverpath+"/ajax/account/mlink_ssoLogin.action",
				type:"post",
				data:{sourceurl:sourceurl},
				async: false,
				dataType:"json",
				success:function (root){ 
					//location.href=serverpath+"/music/musicmain.3.jsp?music_link="+root;
					location.href=root;
				}
		 }); 
	}else{
		//location.href=serverpath+"/login/login.3.jsp";
		//location.href=serverpath+"/music/musicmain.3.jsp?music_link="+sourceurl;
		location.href=sourceurl;
	} 
}

/**
 * 获得视频页的订购状态
 */
function getVideoOrderStatus(serverpath,resourceId,wwj_path,url1,url2,playordown){
	if("play" == playordown){
		location.href=serverpath+"/ajax/ResourceReturnServlet?wwj_path="+wwj_path+"&resourcesId="+resourceId+"&resourceType=3&video_type=play&url1="+url1+"&url2="+url2;
	}else if("down" == playordown){
		window.open(serverpath+"/ajax/ResourceReturnServlet?wwj_path="+wwj_path+"&resourcesId="+resourceId+"&resourceType=3&video_type=down&url1="+url1+"&url2="+url2);
	}  
}

/**
 * 是否显示验证码
 * @param serverpath
 */
function isShowImageVerifyCode(serverpath){
	var userName =$("#userName").val();
	jQuery.ajax({
		url:serverpath+"/ajax/account/isShowImageVerifyCode.action",
		type:"post",
		data:{userName:userName},
		async: false,
		dataType:"json",
		success:function (root){   
			/*显示*/
			if("true" == root){
				changeImageCode_login(serverpath);
	        	$("#verifyCode").val("");
	        	$("#verifyCodeDiv").show();
			}else{
				changeImageCode_login(serverpath);
	        	$("#verifyCode").val("");
	        	$("#verifyCodeDiv").hide();
			}
		}
 }); 
}

function test1(serverpath){ 
    jQuery.getJSON(serverpath+"/ajax/common/doOrderResources.action?jsoncallback=?",
    	    {name:"1"},function(data){
    	        var status = data.resultCode;
    	        var promptMessage = data.promptMessage;
    	        alert(status+" ************** "+promptMessage);
    	    });
}
/*wangp end*/


